//
//  IsTheTrailerIsOverloadedView.m
//  NtoccDriverNew
//
//  Created by 张天兴 on 2025/9/19.
//  Copyright © 2025 GCY. All rights reserved.
//

#import "IsTheTrailerIsOverloadedView.h"

@implementation IsTheTrailerIsOverloadedView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame: frame];
    if (self) {
       
        [self setUI];
    }
    return self;
}
- (void)setUI{
    [self addSubview:self.bottomView];
}
-(UIView *)bottomView{
    if (_bottomView == nil) {
        self.bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenW, ScreenH)];
        self.bottomView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.8];
        [self.bottomView addSubview:self.bgView];
    }
    return _bottomView;
}
-(UIView *)bgView{
    if (_bgView == nil) {
        self.bgView = [[UIView alloc] initWithFrame:CGRectMake((ScreenW - 335)/2, (ScreenH - 174)/2, 335, 194)];
        self.bgView.layer.masksToBounds = YES;
        self.bgView.layer.cornerRadius = 10;
        self.bgView.backgroundColor = [UIColor whiteColor];
        [self.bgView addSubview:self.topImagView];
        [self.bgView addSubview:self.tishiLabel];
        [self.bgView addSubview:self.isChaoButton];
        [self.bgView addSubview:self.isGuaNextButton];
    }
    return _bgView;
}
- (UIImageView *)topImagView{
    if (_topImagView == nil) {
        self.topImagView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 305, 44)];
        self.topImagView.image = [UIImage imageNamed:@"chaopaiTopImag"];
    }
    return _topImagView;
}
-(UILabel *)tishiLabel{
    if (_tishiLabel == nil) {
        self.tishiLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, CGRectGetMaxY(self.topImagView.frame) + 10, 287, 60)];
        self.tishiLabel.text = @"提示：您的货物如果是三超货物，临时用这个超牌代替行驶证和道路运输证，请选择是超是超限牌";
        self.tishiLabel.textColor = [UIColor redColor];
        self.tishiLabel.font = [UIFont systemFontOfSize:15];
        self.tishiLabel.numberOfLines = 0;
    }
    return _tishiLabel;
}
- (UIButton *)isChaoButton{
    if (_isChaoButton == nil) {
        self.isChaoButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        self.isChaoButton.frame = CGRectMake(10, CGRectGetMaxY(self.tishiLabel.frame) + 10, (277 / 2), 44);
        [self.isChaoButton setTitle:@"是超限牌" forState:(UIControlStateNormal)];
        [self.isChaoButton setTitleColor:Theme_ColorValue forState:(UIControlStateNormal)];
        self.isChaoButton.layer.masksToBounds = YES;
        self.isChaoButton.layer.cornerRadius = 10;
        self.isChaoButton.layer.borderWidth = 1;
        self.isChaoButton.layer.borderColor = Theme_ColorValue.CGColor;
        self.isChaoButton.backgroundColor = [UIColor whiteColor];
    }
    return _isChaoButton;
}
- (UIButton *)isGuaNextButton{
    if (_isGuaNextButton == nil) {
        self.isGuaNextButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        self.isGuaNextButton.frame = CGRectMake(CGRectGetMaxX(self.isChaoButton.frame) + 20, CGRectGetMaxY(self.tishiLabel.frame) + 10, (277 / 2), 44);
        [self.isGuaNextButton setTitle:@"正常挂车,下一步" forState:(UIControlStateNormal)];
        [self.isGuaNextButton setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
        self.isGuaNextButton.layer.masksToBounds = YES;
        self.isGuaNextButton.layer.cornerRadius = 10;
        self.isGuaNextButton.backgroundColor = Theme_ColorValue;
    }
    return _isGuaNextButton;
}
@end
